home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / VBSamples / Demos / AirHockey / frmGraphics.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-10-08  |  5.6 KB  |  168 lines

  1. VERSION 5.00
  2. Begin VB.Form frmGraphics 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Graphic Options"
  5.    ClientHeight    =   3360
  6.    ClientLeft      =   45
  7.    ClientTop       =   285
  8.    ClientWidth     =   6405
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   3360
  13.    ScaleWidth      =   6405
  14.    ShowInTaskbar   =   0   'False
  15.    StartUpPosition =   1  'CenterOwner
  16.    Begin VB.CommandButton cmdOk 
  17.       Caption         =   "OK"
  18.       Default         =   -1  'True
  19.       Height          =   375
  20.       Left            =   5340
  21.       TabIndex        =   0
  22.       Top             =   2880
  23.       Width           =   975
  24.    End
  25.    Begin VB.CommandButton cmdCancel 
  26.       Cancel          =   -1  'True
  27.       Caption         =   "Cancel"
  28.       Height          =   375
  29.       Left            =   4260
  30.       TabIndex        =   5
  31.       Top             =   2880
  32.       Width           =   975
  33.    End
  34.    Begin VB.Frame Frame1 
  35.       Caption         =   "Options"
  36.       Height          =   2655
  37.       Left            =   60
  38.       TabIndex        =   6
  39.       Top             =   120
  40.       Width           =   6255
  41.       Begin VB.CommandButton cmdChgMode 
  42.          Caption         =   "Change..."
  43.          Height          =   315
  44.          Left            =   180
  45.          TabIndex        =   1
  46.          Top             =   900
  47.          Width           =   1575
  48.       End
  49.       Begin VB.OptionButton optOffice 
  50.          Caption         =   "Office Lobby (Less detailed, higher performance)"
  51.          Height          =   255
  52.          Left            =   120
  53.          TabIndex        =   4
  54.          Top             =   2280
  55.          Width           =   4935
  56.       End
  57.       Begin VB.OptionButton optGame 
  58.          Caption         =   "Game Room (More detailed, lower performance)"
  59.          Height          =   255
  60.          Left            =   120
  61.          TabIndex        =   3
  62.          Top             =   1980
  63.          Value           =   -1  'True
  64.          Width           =   4935
  65.       End
  66.       Begin VB.CheckBox chkDrawRoom 
  67.          Caption         =   "Display the room where the game is taking place."
  68.          Height          =   315
  69.          Left            =   120
  70.          TabIndex        =   2
  71.          Top             =   1260
  72.          Width           =   4095
  73.       End
  74.       Begin VB.Label lblMode 
  75.          BackStyle       =   0  'Transparent
  76.          BorderStyle     =   1  'Fixed Single
  77.          Caption         =   "Label1"
  78.          Height          =   255
  79.          Left            =   1245
  80.          TabIndex        =   10
  81.          Top             =   570
  82.          Width           =   4815
  83.       End
  84.       Begin VB.Label Label2 
  85.          BackStyle       =   0  'Transparent
  86.          Caption         =   "Display Mode"
  87.          Height          =   255
  88.          Index           =   2
  89.          Left            =   180
  90.          TabIndex        =   9
  91.          Top             =   600
  92.          Width           =   1095
  93.       End
  94.       Begin VB.Label lblRoom 
  95.          BackStyle       =   0  'Transparent
  96.          Caption         =   "If the room is displayed, what type of room should be displayed?"
  97.          Height          =   255
  98.          Left            =   120
  99.          TabIndex        =   8
  100.          Top             =   1680
  101.          Width           =   4635
  102.       End
  103.       Begin VB.Label Label2 
  104.          BackStyle       =   0  'Transparent
  105.          Caption         =   "You can control different options here to improve graphic quality, or performance"
  106.          Height          =   255
  107.          Index           =   0
  108.          Left            =   120
  109.          TabIndex        =   7
  110.          Top             =   240
  111.          Width           =   6015
  112.       End
  113.    End
  114. Attribute VB_Name = "frmGraphics"
  115. Attribute VB_GlobalNameSpace = False
  116. Attribute VB_Creatable = False
  117. Attribute VB_PredeclaredId = True
  118. Attribute VB_Exposed = False
  119. Option Explicit
  120. Private Sub chkDrawRoom_Click()
  121.     EnableRoomInfo (chkDrawRoom.Value = vbChecked)
  122. End Sub
  123. Private Sub cmdCancel_Click()
  124.     Unload Me
  125. End Sub
  126. Private Sub cmdChgMode_Click()
  127.     goDev.Show vbModal
  128.     'Now that we've potentially changed modes, update them
  129.     If goDev.Windowed Then
  130.         lblMode.Caption = "Windowed mode"
  131.     Else
  132.         lblMode.Caption = goDev.ModeString
  133.     End If
  134. End Sub
  135. Private Sub cmdOk_Click()
  136.     SaveAudioSettings
  137.     Unload Me
  138. End Sub
  139. Private Sub Form_Load()
  140.     'Now update the display
  141.     chkDrawRoom.Value = Abs(goRoom.DrawRoom)
  142.     optGame.Value = goRoom.BarRoom
  143.     optOffice.Value = Not goRoom.BarRoom
  144.     If goDev.Windowed Then
  145.         lblMode.Caption = "Windowed mode"
  146.     Else
  147.         lblMode.Caption = goDev.ModeString
  148.     End If
  149.     EnableRoomInfo (chkDrawRoom.Value = vbChecked)
  150. End Sub
  151. Private Sub SaveAudioSettings()
  152.     goRoom.DrawRoom = (chkDrawRoom.Value = vbChecked)
  153.     goRoom.BarRoom = optGame.Value
  154. End Sub
  155. Private Sub Form_Unload(Cancel As Integer)
  156.     'We're leaving the form, save the settings
  157.     SaveSetting gsKeyName, gsSubKey, "DrawRoom", goRoom.DrawRoom
  158.     SaveSetting gsKeyName, gsSubKey, "RoomIsBarRoom", goRoom.BarRoom
  159.     SaveSetting gsKeyName, gsSubKeyGraphics, "Windowed", goDev.Windowed
  160.     SaveSetting gsKeyName, gsSubKeyGraphics, "AdapterID", goDev.Adapter
  161.     SaveSetting gsKeyName, gsSubKeyGraphics, "Mode", goDev.Mode
  162. End Sub
  163. Private Sub EnableRoomInfo(ByVal fEnable As Boolean)
  164.     lblRoom.Enabled = fEnable
  165.     optGame.Enabled = fEnable
  166.     optOffice.Enabled = fEnable
  167. End Sub
  168.